package gttp.nspa.client;

import com.google.gwt.user.client.ui.HorizontalPanel;
import com.sencha.gxt.core.client.util.ToggleGroup;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.form.Radio;

public class TherapistForm extends HumanForm {

    private static final String LEVEL_KEY = "Level";

    protected ToggleGroup       tgLevel;

    public TherapistForm() {
        super("Therapist", 350, 75);
    }

    protected void createFormFields(VerticalLayoutContainer con) {
        super.createFormFields(con);

        tgLevel = new ToggleGroup();

        Radio r;
        HorizontalPanel hp = new HorizontalPanel();

        r = new Radio();
        r.setBoxLabel("Thấp");
        r.setData(LEVEL_KEY, new Integer(1));
        r.setValue(true);
        hp.add(r);
        tgLevel.add(r);

        r = new Radio();
        r.setBoxLabel("Trung");
        r.setData(LEVEL_KEY, new Integer(2));
        hp.add(r);
        tgLevel.add(r);

        r = new Radio();
        r.setBoxLabel("Cao");
        r.setData(LEVEL_KEY, new Integer(3));
        hp.add(r);
        tgLevel.add(r);

        FieldLabel fl = new FieldLabel(hp, "Cấp độ");
        fl.setLabelWidth(labelWidth);
        con.add(fl, new VerticalLayoutData(1, -1));
    }
}
